package edu.hawaii.duedates.wicket;

import org.apache.wicket.markup.html.WebPage;
import edu.hawaii.duedates.DueDates;

/**
 * This class will be used by the webapp.
 * 
 * @author robin
 *
 */
public class DueDatesPage extends WebPage {
  
  /** Support serialization. */ 
  private static final long serialVersionUID = 1L; 
  
  /**
   * Returns the DueDates session for the user.
   * 
   * @return The DueDates session.
   */
  public DueDatesSession getDueDatesSession() {
    return (DueDatesSession) getSession();
  }
  
  /**
   * Returns DueDates instance for the user.
   * 
   * @return The DueDates instance.
   */
  public DueDates getDueDates() {
    return getDueDatesSession().getDueDates();
  }
  
  /**
   * Sets the user's input for wakeup interval.
   * 
   * @param intervalInput The user's input.
   */
  public void setWakeUpInterval(double intervalInput) {
    getDueDatesSession().setInterval(intervalInput);
  }
  
  /**
   * Gets the user's input for wakeup interval.
   * 
   * @return The user's input.
   */
  public double getWakeUpInterval() {
    return getDueDatesSession().getInterval();
  }
  
  /**
   * Sets the within value.
   * 
   * @param withinVal The within value.
   */
  public void setWithinValue(int withinVal) {
    getDueDatesSession().setWithin(withinVal);
  }
  
  /**
   * Gets the within value.
   * 
   * @return The within value.
   */
  public int getWithinValue() {
    return getDueDatesSession().getWithin();
  }
  
  /**
   * Sets an error message.
   * 
   * @param error The error message.
   */
  public void setErrorMessage(String error) {
    getDueDatesSession().setErrorMessage(error);
  }
  
  /**
   * Gets the error message.
   * 
   * @return The error message.
   */
  public String getErrorMessage() {
    return getDueDatesSession().getErrorMessage();
  }
  
  /**
   * Sets the sort option.
   * 
   * @param sort The sort option.
   */
  public void setSortOption(String sort) {
    getDueDatesSession().setSortOption(sort);
  }
  
  /**
   * Gets the sort option.
   * 
   * @return Returns the sort option.
   */
  public String getSortOption() {
    return getDueDatesSession().getSortOption();
  }
  
  /**
   * Gets the withinAll Value.
   * 
   * @return Returns the withinAll value.
   * 
   */
  public int getWithinAll() {
    return getDueDatesSession().getWithinAll();
  }
  
  /**
   * Sets the withinAll.
   * 
   * @param withinAll the withinAll value to set.
   * 
   */
  public void setWithinAll(int withinAll) {
    getDueDatesSession().setWithinAll(withinAll);
  }
  
  /**
   * Sets the isAllLib.
   * 
   * @param isAllLib True if all libraries are to be displayed.
   */
  public void setIsAllLib(boolean isAllLib) {
    getDueDatesSession().setIsAllLib(isAllLib);
  }
  
  /**
   * Gets the isAllLib value.
   * 
   * @return isAll True if all libs are to be displayed
   */
  public boolean isAllLib() {
    return getDueDatesSession().isAllLib();
  }
}
